package com.wl.designpattern.visitor;

/**
 * 创建具体元素
 * Created by wangliang on 2021/2/27.
 */
public class Music extends Web {
    public Music(String name) {
        super(name);
    }

    @Override
    public void accept(Visitor visitor) {//接受访问者的访问
        visitor.visit(this);
    }

    @Override
    public void download() {//实现父类中的公共方法
        System.out.println("下载音乐~~");
    }

    public void playMusic() {//音乐类独有方法
        System.out.println("播放音乐ing");
    }
}
